/**
 * Copyright (C) 2015-2016  Shuishun Zhou  All Rights Reserved.
 * File name:       com_dll_api_linux.c
 * Version:         0.0.1
 * Description:     simple common dll api for linux gcc
 * Function List:
 * History:
 * No.          Date        Author          Note
 * 01       2015-02-23  Water (sszhouplus@qq.com) Create v0.0.1
 **/
#include <dlfcn.h>
#include "com_dll_api.h"

void *dll_open(const char *dll_name)
{
	return dlopen(dll_name, RTLD_LAZY);
}

void *dll_close(void *dll_module)
{
	if (0 == dlclose(dll_module))
		return 0;
	return dll_module;
}

void *dll_get_symbol(void *dll_module, const char *sym_name)
{
	return dlsym(dll_module, sym_name);
}

char *dll_last_error(void)
{
	return dlerror();
}
